package com.study.scala.implicits

/**
  * 隐式转换
  *
  * @author stephen
  * @create 2019-03-18 17:58
  * @since 1.0.0
  */
object ImplicitDemo extends App {

  // 导入隐式转换
  import ImplicitAspect._

  // 使用增强的方法
  val man = new Man("zhang san")
  man.eat()
  man.fly()

}

class Man(val name: String) {
  def eat(): Unit = {
    println(s"man [$name] eat ...")
  }

}

class SuperMan(val name: String) {
  def fly(): Unit = {
    println(s"super man [$name] fly ...")
  }
}
